public class calculate {
    //类中需要抛异常，用的时候也需要抛,throws是主动去判断，trycatch是去运行去捕获异常，但是不使程序终止
    public static int sum(int number1, int number2) throws Exception {
        if(number1>100||number2>100||number1<0||number2<0){
            throw new Exception("只能计算一百以内加法");
        }
        return number1+number2;
    }
    public static int differ(int number1, int number2) {
        return number1-number2;
    }
}
